package com.nsfocus.network;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;

/**
 * @File: ScreenCastServer.java
 * @User: Liangkangkang
 * @Date: 17-4-25
 * @Time: 上午10:23
 * @Mail: liangkangkang@yahoo.com
 * @Desc:
 * @Version:
 */

public class ScreenCastServer {
    public static void main(String[] args) throws  Exception{
        Rectangle rect = new Rectangle(0,0,100,768);
        BufferedImage image = new Robot().createScreenCapture(rect);
        System.out.println(image);
        ImageIO.write(image,"jpg",new FileOutputStream("/home/lkk/screen.jpg"));
        System.out.println("------------");
    }
}
